package com.atguigu.thread;

public class Sell extends Thread {

    public int ticket = 50;

    public static void main(String[] args) {
        Thread thread1 = new Thread();
        Thread thread2 = new Thread();
        Thread thread3 = new Thread();

    }

    public synchronized void sell() {
        ticket = ticket - 1;
        System.out.println("现在还剩" + ticket);
    }
}
